<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<!DOCTYPE html>
<html lang="zh-CN" >
<head>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>厂商详情</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>
<body class="iframeBody">
<div class="Wrapper">
<div class="Wrapper">
	<div id="pageInTab" class="pageInTab">
		<div tabid="tabA" title="基本信息" lselected="true">
            <form id="formSet1">
            	<div class="fieldset1 tabel_col clearFix">
            		<div class="caption">
                        <span class="title">厂商信息</span>
                    </div>
                    <div class="fieldBox col_33">
	                    <div class="label">厂商名称</div>
	                    <div class="field">
	                    	<span name="mfrNm" id="mfrNm">&nbsp;</span>
	                    </div>
	                </div>
                    <div class="fieldBox col_33">
	                    <div class="label">是否供应商</div>
	                    <div class="field">
	                    	<span name="isSpl" id="isSpl">&nbsp;</span>
	                    </div>
	                </div>
	                <div class="fieldBox col_33">
	                    <div class="label">厂商传真</div>
	                    <div class="field">
	                    	<span name="mfrFax" id="mfrFax">&nbsp;</span>
	                    </div>
	                </div>
                    <div class="fieldBox col_66">
	                    <div class="label">厂商地址</div>
	                    <div class="field">
	                    	<span name="mfrAddr" id="mfrAddr">&nbsp;</span>
	                    </div>
	                </div>
                    <div class="fieldBox col_33">
	                    <div class="label">厂商电话</div>
	                    <div class="field">
	                    	<span name="mfrTel" id="mfrTel">&nbsp;</span>
	                    </div>
	                </div>
                    <div class="fieldBox col_33">
	                    <div class="label">联系人</div>
	                    <div class="field">
	                    	<span name="lmNm" id="lmNm">&nbsp;</span>
	                    </div>
	                </div>
                    <div class="fieldBox col_33">
	                    <div class="label">身份证号</div>
	                    <div class="field">
	                    	<span name="lmIdNum" id="lmIdNum">&nbsp;</span>
	                    </div>
	                </div>
                    <div class="fieldBox col_33">
	                    <div class="label">办公电话</div>
	                    <div class="field">
	                    	<span name="lmOfficeTel" id="lmOfficeTel">&nbsp;</span>
	                    </div>
	                </div>
                    <div class="fieldBox col_66">
	                    <div class="label">常住地址</div>
	                    <div class="field">
	                    	<span name="lmAddr" id="lmAddr">&nbsp;</span>
	                    </div>
	                </div>
	                <div class="fieldBox col_33">
	                    <div class="label">邮编</div>
	                    <div class="field">
	                    	<span name="lmZipNo" id="lmZipNo">&nbsp;</span>
	                    </div>
	                </div>
                    <div class="fieldBox col_33">
	                    <div class="label">EMAIL</div>
	                    <div class="field">
	                    	<span name="lmEMail" id="lmEMail">&nbsp;</span>
	                    </div>
	                </div>
                    <div class="fieldBox col_33">
	                    <div class="label">手机号码</div>
	                    <div class="field">
	                    	<span name="lmMp1" id="lmMp1">&nbsp;</span>
	                    </div>
	                </div>
                    <div class="fieldBox col_33">
	                    <div class="label">手机号码2</div>
	                    <div class="field">
	                    	<span name="lmMp2" id="lmMp2">&nbsp;</span>
	                    	<input name="mId" id="mId" type="hidden" value="${id }">
	                    </div>
	                </div>
					<div class="fieldBox col_100">
						<div class="label">放款方式</div>
						<div class="field">
							<span name="payTypCdNm" id="payTypCdNm">&nbsp;</span>
						</div>
					</div>
            	</div>
            
                
            </form>
        </div>
		<div tabid="tabB" title="资料信息">
            <iframe frameborder="0" name="tabB" id="tabB" src=""></iframe>
        </div>
		<div tabid="tabC" title="授信备案">
	        <iframe frameborder="0" name="tabC" id="tabC" src=""></iframe>
	    </div>
		<div tabid="tabD" title="远程跟踪">
	        <iframe frameborder="0" name="tabD" id="tabD" src=""></iframe>
	    </div>
	</div>
</div>
</div>


<script type="text/javascript">

var loadedTabs=[];

$(function () {
    $("#formSet1").ligerForm({
        validate : true
    });
   
 	 //初始化数据
    initData();
    
});


function initData(){
	var _id = $("#mId").val();
	var _url = '<%=path%>/product/mfrInfo/getById.do';
	$.ajax({
		type: 'get',
		dataType:'json',
		data:{id:_id},
		url: _url,
		success:function(msg){
			 if(msg.success == 1){
				 setData(msg.data);//设置数据
			 }else{
				 $.ligerDialog.warn(msg.info);
			 }
		}
	});
	initTab();
}

//设置页面数据
function setData(data){
	
	var form = new liger.get("formSet1");
	$("#mfrNm").html(data.mfrNm);
	$("#mfrAddr").html(data.mfrAddr);
	$("#mfrFax").html(data.mfrFax);
	$("#mfrTel").html(data.mfrTel);
	$("#lmNm").html(data.lmNm);
	$("#lmIdNum").html(data.lmIdNum);
	$("#lmOfficeTel").html(data.lmOfficeTel);
	$("#lmZipNo").html(data.lmZipNo);
	$("#lmAddr").html(data.lmAddr);
	$("#lmMp1").html(data.lmMp1);
	$("#lmMp2").html(data.lmMp2);
	$("#lmEMail").html(data.lmEMail);
    $("#payTypCdNm").html(data.payTypCdNm);
	
	if(data.isSpl==1){
		$("#isSpl").html("是");
	}else if(data.isSpl==0){
		$("#isSpl").html("否");
	}
}

//初始化Tab页
function initTab(){
	pageInTab = $("#pageInTab").ligerTab({
        height: 'auto',
        contextmenu: false,
        minIframeHeight: 450,
        onBeforeSelectTabItem: function (tabid) {
        	var _mId = $("#mId").val();
        	if(tabid!="tabA"){
                if(!_mId){
                	top.$.ligerDialog.SQalert({content: "请确认厂商基本信息已存在", SQ_type: "warning"});
                	return false;
                }
        	}
        },
        onAfterSelectTabItem: function(tabid) {
            if (loadedTabs.indexOf(tabid)<0) {
            	var _mId = $("#mId").val();
            	if(tabid!="tabA"){
                	if(!_mId){
                		 top.$.ligerDialog.SQalert({content: "请确认厂商基本信息已存在", SQ_type: "warning"});
                         return false; 
                	}
            	}
                loadedTabs.push(tabid);
                /*switch (tabid){
                    case "tabB":
                        pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjQuatPrpsAttr/toDetailPage.do?prpsCfgId="+_prpsCfgId);
                        break;
                    case "tabC":
                        pageInTab.setTabItemSrc(tabid, "<%=path%>/project/prjQuatPrpsCfgAi/toDetailListPage.do?prpsCfgId="+_prpsCfgId);
                        break;
                }*/
            };
            SetIframe_height();
        }
    });

    /* $.extend(true, pageInApp, {
        pageInTab: pageInTab
    }); */
};


</script>



</body>
</html>
